﻿using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Security.Principal;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.Security;
using Wekit.Web.Models;
using Wekit.Web.Security;
namespace Wekit.Controllers.Website
{

    [HandleError]
    public class AccountController : Controller
    {
        /// <summary>
        /// 服务提供类
        /// </summary>
        public IPrincipalService PrincipalService { get; set; }

        public ActionResult Register()
        {
            ViewData["PasswordLength"] = 8;
            return View();
        }

        [HttpPost]
        public ActionResult Register(RegisterModel model)
        {
          Wekit.Model.Auth.User user=PrincipalService.createUser(model);
          if (user.Id != null)
              user.Id = "fdsfds";
          return View();
        }


        [Authorize]
        public ActionResult ChangePassword()
        {
            return View();
        }

        [Authorize]
        [HttpPost]
        public ActionResult ChangePassword(ChangePasswordModel model)
        {

            ViewData["PasswordLength"] = 8;
            return View(model);
        }


        public ActionResult ChangePasswordSuccess()
        {
            return View();
        }

    }

}
